#include "LLogicMap.h"
#include "scene/SceneBase.h"

CLLogicMap::CLLogicMap(void)
{
}


CLLogicMap::~CLLogicMap(void)
{
}

void CLLogicMap::LogicInit() {
	AddLogicType(GLSLTMapTask);
}

bool CLLogicMap::CatchLogic(const ProtocolBase *head, char * data, uint32_t len, void * connect) {
	if (!this->ExistLogicType(head->m_Logic))
		return false;
	switch (head->m_Logic) {
	case GLSLTMapTask:
		if (head->m_From == GLPFromServer) {
			switch (head->m_Action) {
			case GLPAEnter:
				break;
			default:
				break;
			}
		}
		break;
	default:
		break;
	}
	return true;
}

void CLLogicMap::EnterMap(uint32_t type) {
	EnterMapReq tEnter;
	tEnter.m_Logic = type;
	tEnter.m_UserId = m_Oneself->GetBaseInfo().m_Uid;

	m_LogicConnect->SendLenAndData((const char*)&tEnter, sizeof(tEnter));
}

void CLLogicMap::LeaveMap(uint32_t type) {
	LeaveMapReq tLeave;
	tLeave.m_Logic = type;
	tLeave.m_UserId = m_Oneself->GetBaseInfo().m_Uid;

	m_LogicConnect->SendLenAndData((const char*)&tLeave, sizeof(tLeave));
}
